import java.util.Comparator;
import java.util.HashSet;
import java.util.PriorityQueue;

/**
 * @description:
 * @Author: wuzhenbin
 * @CreateTime: 2025/2/16
 */
public class leetcode_215 {
    public static void main(String[] args) {

    }

    public int findKthLargest(int[] nums, int k) {
        PriorityQueue<Integer> heap = new PriorityQueue<>((o1, o2) -> o2-o1);
        for (int num : nums) {
            heap.add(num);
        }
        while(k>0){
            heap.poll();
            k--;
        }
        return heap.poll();
    }

}
